<!-- 基础信息 -->

<template>
  <div>
    <FormInput label="计划名称" bind="planName" :max="20" required />

    <EasyRow col2>
      <FormTime label="生效时间" bind="startTime" future string required />
      <FormTime label="失效时间" bind="endTime" future string />
    </EasyRow>

    <EasyRow col2>
      <FormSelect v-bind="typeProps" />
      <FormSelect v-bind="subTypeProps" />
    </EasyRow>

    <EasyRow col2>
      <FormTree label="出发地" bind="areaIdStart, areaNameStart" :dict="CORE.REGION.DICT" allName required />
      <FormTree label="目的地" bind="areaIdEnd, areaNameEnd" :dict="CORE.REGION.DICT" allName required />
    </EasyRow>

    <EasyRow col2>
      <FormSelect
        label="运送工具"
        bind="deliverToolId, deliverToolName, deliverToolCode"
        :dict="CORE.DICT.deliver_tool"
        required
      />
      <FormSelect label="紧急程度" bind="urgency" :dict="CORE.DICT.URGENCY" initFirst noClear required />
    </EasyRow>
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import MyModal from '@admin/views/Maintain/Deliver/DeliverTemplate/MyModal'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyBase',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    ...MyModal.computed,
  },

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 切换类型
     */
    changeType() {
      Object.assign(this.one, {
        principalId: '',
        principalUserName: '',
        principalUserPhone: '',
      })
    },
  },
}
</script>
